function deepClose(orginValue, map = new WeakMap()) {
  // Set, Map, WeakSet, WeakMap的拷贝处理
  if (orginValue instanceof Set) {
    return new Set([...orginValue]);
  }
  if (orginValue instanceof Map) {
    return new Map([...orginValue]);
  }
  if (orginValue instanceof WeakSet || orginValue instanceof WeakRef) {
    return orginValue;
  }

  // Symbol的拷贝处理
  if (typeof orginValue === "symbol") {
    if (Symbol.keyFor(orginValue) == null) {
      return Symbol();
    } else {
      return orginValue;
    }
  }

  // 基础数据类型和Function的拷贝处理
  if (!isObject(orginValue) || typeof orginValue === "function") {
    return orginValue;
  }

  //检出数组是否存在循环引用
  if (map.has(orginValue)) {
    return map.get(orginValue);
  }

  //数组和普通对象的拷贝处理
  const newObject = Array.isArray(orginValue) ? [] : {};

  //String key的拷贝处理
  for (const key in orginValue) {
    newObject[key] = deepClose(orginValue[key], map);
  }

  //Symbol key的拷贝处理
  const symbols = Object.getOwnPropertySymbols(orginValue);
  for (const key of symbols) {
    newObject[key] = deepClose(orginValue[key], map);
  }

  map.set(orginValue, newObject);
  return newObject;
}

function isObject(value) {
  const valueType = typeof value;
  return value != null && (valueType === "object" || valueType === "function");
}
